/*
 * @Author: sunzhijun 
 * @Date: 2020-02-28 21:39:19 
 * @Last Modified by: sunzhijun
 * @Last Modified time: 2020-03-05 15:56:53
 */

import React from 'react';
import {render, connect} from 'src/hrpub/common/frame';
import NewIncreased from '../../../../public/components/NewIncreased';
import newIncreasedRefs from './functions';
import FormView from './formview.js';
import TableAction from '../../actions/table';
import NewaddAction from '../../actions/newadd';
import CardAction from '../../actions/card';
import BtnAction from '../../actions/btn';
import HeaderAction from '../../actions/header';

// import './index.less';

const NewAdd = render({
    actions: {
        newaddAct: NewaddAction,
        tableAct: TableAction,
        cardAct: CardAction,
        btnAct: BtnAction,
        headerAct: HeaderAction
    }
})(({props, action, state}) => {
    const { main } = props;
    let { setModalVisible, appConfig, pk_org } = main;
    let param = {
        pkOrg: pk_org,
        appCode: appConfig && appConfig.appcode,
        pageCode: appConfig && appConfig.pagecode
    }
    return (
        !!setModalVisible ? 
        <NewIncreased
            {...props}
            {...param}
            setModalVisible = { setModalVisible }
            fntype = {'apply'}
            ref={ node => {
                newIncreasedRefs.refs = node
            }}
            prevHandle={action.newaddAct.prevHandle}
            nextHandle={action.newaddAct.nextHandle}
            doneHandle={action.newaddAct.doneHandle}
            // isInterrupt={this.state.isInterrupt}
            // selectExtendStyle={this.selectExtendStyle.bind(this)}
            onClose={action.newaddAct.onClose}
        >
            <FormView
                {...props}
            ></FormView>
        </NewIncreased> : null
    );
});
export default NewAdd;